package thread.pool;

public class MultiThreading1 implements Runnable {
	public void run() {
		System.out.println("one run method..");
		
	}
	public static void main(String[] args) {
		Thread t1 = new Thread(new MultiThreading1());//passing annonymous object of TestMultitasking2 class  
		Thread t2 = new Thread(new MultiThreading1());
	t1.start();
	t2.start();
	
	}
}
/*each thread run in separate thread 
 * 
 * -----> there are 3 thread in program not 2 thread because two thread t1@t2 and other one is main() Thread
 *   
 *   
 */

//****************************Annonymous Method*********************************
/**Whenever an object is instantiated but is not assigned a reference variable, it is called anonymous 
 * object instantiation.

     Simple object instantiation:
     Sample s = new Sample();

     Anonymous object instantiation:
     new Sample();

The anonymous object is created and dies instantaneously. But, still  with anonymous objects work can be
 extracted before it dies like calling a method using the anonymous object:

     new Sample().display()

The anonymous object can be used only once in the program.  We can’t use  twice or more as the anonymous
 object dies immediately after doing its  assigned task.

BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

 */

